#include "misc.h"

template <typename T>
int misc::update_this(T list)
{
	int count=0;

	if(!list.empty())
	{
		T::const_iterator blci = list.begin();
		T::const_iterator blli = list.end();
		
		T::const_iterator blxi	= blci;

		for(blci;blci!=blli;)
		{
			blxi=blci;
			blxi++;
			(*blci)->Update();
			blci=blxi;
			count++;
		}

	}

	return count;
}

template <typename T>
int misc::free_list(T list)
{
	int count=0;

	if(!list.empty())
	{
		T::const_iterator blci = list.begin();
		T::const_iterator blli = list.end();
		
		T::const_iterator blxi	= blci;

		for(blci;blci!=blli;)
		{
			blxi=blci;
			blxi++;
			delete (*blci);
			blci=blxi;
			count++;
		}

	}

	return count;
}